package com.zzvcom.webapp.action.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.zzvcom.persist.model.admin.Article;
import com.zzvcom.service.admin.ArticleManager;

@Controller
@Scope("prototype")
public class ArticleViewAction
{

	private String id;
	
	private Article article;

	private ArticleManager manager;

	public String find()
	{
		article = manager.get(id);
		return "article";
	}
	
	public String about()
	{
		id="about";
		return find();
	}
	
	public String contact()
	{
		id="contact";
		return find();
	}

	public ArticleManager getManager()
	{
		return manager;
	}

	@Autowired
	public void setManager(ArticleManager manager)
	{
		this.manager = manager;
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public Article getArticle()
	{
		return article;
	}

	public void setArticle(Article article)
	{
		this.article = article;
	}

}
